#!/usr/bin/python
#coding=utf-8
'''
    4.11 同时迭代多个序列
    想同时迭代多个序列，每次分别从一个序列中取一个元素
    用zip()
'''

# 为了同时迭代多个序列，使用zip()函数
# 迭代长度跟参数中最短序列长度一致
xpts = [1, 5, 4, 2, 10, 7]
ypts = [101, 78, 37, 15, 62, 99]
for x, y in zip(xpts, ypts):
    print(x, y)

a = [1, 2, 3]
b = ['w', 'z', 'y', 'z']
for i in zip(a, b):
    print(i)